<?php
class Bdc extends AppModel
{
    /**
     * associations
     */
    var $hasMany = array(
        'BdcUser' => array(
            'className' => 'BdcUser',
            'foreignKey' => 'bdc_id',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        ),
        'Omc' => array(
            'className' => 'Omc',
            'foreignKey' => 'bdc_id',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        )
    );

    var $hasAndBelongsToMany = array(
        'Module' => array(
            'className' => 'Module',
            'joinTable' => 'bdc_modules',
            'foreignKey' => 'bdc_id',
            'associationForeignKey' => 'module_id',
            'unique' => true,
            'conditions' => '',
            'fields' => '',
            'order' => array('Module.name'=>'ASC'),
            'limit' => '',
            'offset' => '',
            'finderQuery' => '',
            'deleteQuery' => '',
            'insertQuery' => ''
        )
    );


    function getBdcById($id=null){
        return $this->find('first',array('conditions'=>array('id'=>$id),'recursive'=>-1));
    }


}
